package cn.ren.hai.base.service.impl;

import cn.ren.hai.core.entity.QueryPage;
import cn.ren.hai.base.entity.RhMenu;
import cn.ren.hai.base.mapper.RhMenuMapper;
import cn.ren.hai.base.service.RhMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import cn.ren.hai.core.entity.PageInfo;

/**
 * <p>
 * 菜单 服务实现类
 * </p>
 *
 * @author wangdao
 * @since 2021-12-29
 */
@Service
public class RhMenuServiceImpl extends ServiceImpl<RhMenuMapper, RhMenu> implements RhMenuService {

    private final RhMenuMapper rhMenuMapper;


    public RhMenuServiceImpl(RhMenuMapper rhMenuMapper) {
        this.rhMenuMapper = rhMenuMapper;
    }

    @Override
    public PageInfo<RhMenu> list(QueryPage<RhMenu> page) {
        QueryWrapper<RhMenu> queryWrapper = new QueryWrapper<>();
        PageHelper.startPage(page);
        return new PageInfo<>(rhMenuMapper.selectList(queryWrapper));
    }
}
